package org.advanced.io;

import java.io.FileReader;
import java.io.FileWriter;

/**
 * @author John.zhang
 * @version Id: ReadWriter, v 1.0 2020/12/14 14:31 ZhiYong Exp $
 */
public class ReadWriter {

    public static void main(String[] args) {
        try(FileReader fileReader = new FileReader("C:/data/io/io03.txt");
            FileWriter fileWriter = new FileWriter("C:/data/io/io03.txt")){
            //fileWriter.write("同程旅游");
            int i = 0;
            char[] chars = new char[1024];
            while ((i=fileReader.read(chars))!=-1){
                System.out.println(new String(chars,0,i));
            }
        }catch (Exception e){

        }
    }

}
